// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

using System;
using System.Collections.Generic;

namespace SnapObjects.Expressions
{
    public interface IMetadataManager<T>
    {
        bool TryGetMetadata(
            MetadataType type,
            object key,
            ParserOptions<T> options,
            out Metadata<T> metadata);

        bool AddMetadataProvider(IMetadataProvider<T> provider);
        bool AddMetadata(Metadata<T> metadata, string sourceKind);

        bool AddMethod<TClass>(string sourceKind) where TClass : class;
        bool AddMethod<TClass>(TClass instance, string sourceKind) where TClass : class;
        bool AddMethod(string name, Delegate method, string sourceKind);

        bool AddParameter(string name, Type type, string sourceKind);
        bool AddVariable(string name, object value, string sourceKind);

        bool AddGroup(string name, IEnumerable<string> conditions, string sourceKind);
        bool AddGroup(string name, Func<object, object> keySelector, string sourceKind);
    }
}
